package edu.spec.student.service.impl;

import edu.spec.student.dao.iface.IMessageDao;
import edu.spec.student.model.Message;
import edu.spec.student.service.iface.IMessageService;
import org.madgecko.basic.model.Pager;
import org.springframework.stereotype.Service;

import javax.inject.Inject;
import java.util.List;


@Service
public class MessageService implements IMessageService {

    @Inject
    private IMessageDao messageDao;

    @Override
    public void add(Message message) {
        messageDao.add(message);
    }

    @Override
    public Message load(Integer messageId) {
        return messageDao.load(messageId);
    }

    @Override
    public Pager<Message> findByMessageDate() {
        return messageDao.findByMessageDate();
    }

    @Override
    public List<Message> listByStudent(Integer studentId) {
        return messageDao.listByStudent(studentId);
    }
}
